UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6E334T9tQblQgOtRWGHx5XpvB1v9AZ4YUup9BacoXKo='
WHERE
key_id = '3c6a243217148d1cf32fb9117cb504f06345ea8a8f724cdd198d5eb6ee436611'
AND (
token = '6E334T9tQblQgOtRWGHx5XpvB1v9AZ4YUup9BacoXKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)