UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pxz77NGKeC6z0VPOzSl7bCitBRK7klpresBYW3owbOI=' 
WHERE 
  key_id = 'f48e0f80e6af5e1ea35f85823417252e8e7413cb4282abc0eb67a2f192455a59' 
  AND (
    token = 'pxz77NGKeC6z0VPOzSl7bCitBRK7klpresBYW3owbOI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036