UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gvGA85FHt38Jy3cN6kcVhJtL3A0xWyZ3sqplRNcu/ww=' 
WHERE 
  key_id = '4d53a79499e2d9fa05f1100d694ec79ef120d62d8b8efc4937d7de13dea96487' 
  AND (
    token = 'gvGA85FHt38Jy3cN6kcVhJtL3A0xWyZ3sqplRNcu/ww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029