UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uIaulwHjFsZALFYy3/aP2Ac1WTV6bAvaBjnOQnK6cig=' 
WHERE 
  key_id = '46597f42ce38d319aef7995a47be7497bee313af14917d4d9e855c273cb2565b' 
  AND (
    token = 'uIaulwHjFsZALFYy3/aP2Ac1WTV6bAvaBjnOQnK6cig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042