UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I7Mq+ofOXzcK9cCr8Td40/JVPyPqCty+njCyty+bZsE=' 
WHERE 
  key_id = 'e90c26d58d957b4535a464aef02a94a12e0ce2915a178c5bcd8ec0ecafc0e893' 
  AND (
    token = 'I7Mq+ofOXzcK9cCr8Td40/JVPyPqCty+njCyty+bZsE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023