UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R1TR/a0Hv76NYwjM6WE3uI8gx/VJP8IzaNIxPVe4Nzo=' 
WHERE 
  key_id = '77814abe5d80ba2ed3df6316bc908c46e9afc38d10c4ac834a4b437876eda9af' 
  AND (
    token = 'R1TR/a0Hv76NYwjM6WE3uI8gx/VJP8IzaNIxPVe4Nzo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029