UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EkXwNf1rZXufkAYdttdVGdu9DDQa7Nwg/V+Z4bRnN/Q=' 
WHERE 
  key_id = '71ff4ef1069580943610c6c57271d43916c660bcefe7ab44adfb3d81c5f33e06' 
  AND (
    token = 'EkXwNf1rZXufkAYdttdVGdu9DDQa7Nwg/V+Z4bRnN/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034