UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wAXmjMg47hlTe4CJQ4cQrWjq8tpwLkmdCyVgsv/3L8s=' 
WHERE 
  key_id = '93ab139ab41603571e59aecd05d7d6c690e95e725f83a198f568b885f4e931bc' 
  AND (
    token = 'wAXmjMg47hlTe4CJQ4cQrWjq8tpwLkmdCyVgsv/3L8s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046