UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pA8lB/6zjAMq+hQ+hW9m+n+zkorYV1EA2EdRl4QEXGM=' 
WHERE 
  key_id = '724dc680568e9a04bea9220bae287aa23a6e0db98a4b2fe9b2f2bad24be044d6' 
  AND (
    token = 'pA8lB/6zjAMq+hQ+hW9m+n+zkorYV1EA2EdRl4QEXGM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034