UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vwYnv4bGU1u/mwHp37Fp0Ao5Ryb8PehoyEmFYM606EM=' 
WHERE 
  key_id = '8fab29b218a4b21ebdb510ffea43fb97e44f294c62e4625f3d1540e78eb7c570' 
  AND (
    token = 'vwYnv4bGU1u/mwHp37Fp0Ao5Ryb8PehoyEmFYM606EM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034