UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SQ/W0f7/SnmG2JEmZ9Am40vQ68AojXetgI8aMGD3t6Q=' 
WHERE 
  key_id = '8224d0e69b02e540eb32a3a3fe66fe1c9fae86fdab85b816a8f67dd157f73520' 
  AND (
    token = 'SQ/W0f7/SnmG2JEmZ9Am40vQ68AojXetgI8aMGD3t6Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028