UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2GT5mSrhUqZVBErGT5FkR6JNT07PIswnql2hbtLzMuo='
WHERE
key_id = '773f614001c6f1d2e9b2bf7c54d8e370c8f8de27da663781d9220dd3b43354dd'
AND (
token = '2GT5mSrhUqZVBErGT5FkR6JNT07PIswnql2hbtLzMuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)