UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nbw/gn984cg+v5VGv2jMgP/i7mU8S0XubUeUb7kdgUQ=' 
WHERE 
  key_id = 'fbb532d3a1e40ac38e7aeab234117cc8ee6fdf3372f4401cd5a0255c4612ba78' 
  AND (
    token = 'Nbw/gn984cg+v5VGv2jMgP/i7mU8S0XubUeUb7kdgUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021