UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XfYHk3NphT3AUp/5AGZsH56v8i6qRRKc+6JpXsswPPk=' 
WHERE 
  key_id = '043507673c15fda5589ab260d19a0623791c46ef9e11cc86e1bd225998a5bb7d' 
  AND (
    token = 'XfYHk3NphT3AUp/5AGZsH56v8i6qRRKc+6JpXsswPPk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031