UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h5xKHuDqxqC/aNaBLNunWEKUrPrAkp6YuoKncjazAWs=' 
WHERE 
  key_id = 'fa150ec9b5ec47a922ce8c73b03bd44645e8ac66ddf51406e6c661106c815e10' 
  AND (
    token = 'h5xKHuDqxqC/aNaBLNunWEKUrPrAkp6YuoKncjazAWs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020