UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NqW1wlBhVpP75HpCHibirt/iMuZnYoQT+prixzYrN+M=' 
WHERE 
  key_id = 'bee10efd3703fd355629dc2d39019e062713d7063e434a01d19910267182c377' 
  AND (
    token = 'NqW1wlBhVpP75HpCHibirt/iMuZnYoQT+prixzYrN+M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045