UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qP6e4btuBCPkmBtjuq+5F1CQ3ORdb/oLFpYIBwBY6Qc=' 
WHERE 
  key_id = '2687fd97dd2e9e8fc04be963885f278fa7655fc1c2a0ec68a3554b861d8bab33' 
  AND (
    token = 'qP6e4btuBCPkmBtjuq+5F1CQ3ORdb/oLFpYIBwBY6Qc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044