UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oabxravzHInc4pJL6cpSfxZLrMH7eUBB3LcpQR4T8BU=' 
WHERE 
  key_id = '7e619c36bd13a9b02848919eed96d0e77c4e8704669bfd11b02087fc9ee777d2' 
  AND (
    token = 'oabxravzHInc4pJL6cpSfxZLrMH7eUBB3LcpQR4T8BU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028