UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u0skMAfPsMxz3yV5H/JcnqjDSoUSwkRcQvxTTLITapk=' 
WHERE 
  key_id = 'ee3c94c5e85dfce0eccc139939fddd7b2db54a1035cf3867f0b1028c4f7c2b8e' 
  AND (
    token = 'u0skMAfPsMxz3yV5H/JcnqjDSoUSwkRcQvxTTLITapk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032