UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bO55VgBC/+VJFuE3/9AQugiNSxS0rxXEVoei2Un5wb0=' 
WHERE 
  key_id = '15698cbc7b578e7de220d54b2501c273bfd942ae5db9783d5d75ccce7096889f' 
  AND (
    token = 'bO55VgBC/+VJFuE3/9AQugiNSxS0rxXEVoei2Un5wb0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048