UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0WxwXgaDsFzqH2urNwS9iI+hheK+2MXxVb3ZLa/pUPY=' 
WHERE 
  key_id = '74871cff5547bc21e4de97e0ec3cf40cf9c03620fd9dbf837b6f8e9093c832ff' 
  AND (
    token = '0WxwXgaDsFzqH2urNwS9iI+hheK+2MXxVb3ZLa/pUPY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025