UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zRoDjcGY3oRZb+Mm7Znzpo1k3hyg4zC8188dcZf3M6o='
WHERE
key_id = '8e3eb9ae9c3f6e092e15608948f45a15fa97084f11d9ace993fdb5657d53b800'
AND (
token = 'zRoDjcGY3oRZb+Mm7Znzpo1k3hyg4zC8188dcZf3M6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)