UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0BpYgXB51w2ozxz0eLPmY44Wjn4W12uo6m1RzK1FQy4='
WHERE
key_id = '62204e4009ff48a6c5bd2118b343c70114fa4a33ff44b1f9b5e05bd6d4dfe35c'
AND (
token = '0BpYgXB51w2ozxz0eLPmY44Wjn4W12uo6m1RzK1FQy4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)