UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zM3I80EWYw2gueRizGUdzKYEvEmHLlW5ftHc2sJ+wXw=' 
WHERE 
  key_id = 'fa0eb8c24fb65c232e6510721f653813a79abf9af6677ae5710114351f353aee' 
  AND (
    token = 'zM3I80EWYw2gueRizGUdzKYEvEmHLlW5ftHc2sJ+wXw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029