UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aEe7fMy+KJjl8jp3jxlzSsjdj0nI2Zi1/kDpbo2WQyg=' 
WHERE 
  key_id = '0926c17b1367fc81807071cc3edff5d059897c2be52ab3a066bcbabe654787b8' 
  AND (
    token = 'aEe7fMy+KJjl8jp3jxlzSsjdj0nI2Zi1/kDpbo2WQyg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027