UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yta0MKvOxVugqfCdwQtISmS3KxQWVbwtyjhudcKr7MI=' 
WHERE 
  key_id = '0891cd592c7ddaa372e14e1b4916cd2afe6e12914d3c754213263fb4b827abce' 
  AND (
    token = 'yta0MKvOxVugqfCdwQtISmS3KxQWVbwtyjhudcKr7MI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034