UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v46d7Y3vvMW2evDc8erlUbcJU8VdN1c+nwXWHV6in8E=' 
WHERE 
  key_id = '0809ed65921fb76ccd39f8ce3e2fec3a822dcd83d7a1820424e8703123a2bc2b' 
  AND (
    token = 'v46d7Y3vvMW2evDc8erlUbcJU8VdN1c+nwXWHV6in8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064