UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VivQjgxb92uCGqmBGJvLWl2jveiLf7yhtBQqjs5ioS4=' 
WHERE 
  key_id = '46f9a4032777cbad4f3eb3df49089bc2b5049d54b225fdce2b30097e6d8255fa' 
  AND (
    token = 'VivQjgxb92uCGqmBGJvLWl2jveiLf7yhtBQqjs5ioS4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027