UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jWwUV6BSjQLQ3Em50nXMYrQLPoRsX37Wc8DVjzDc22c='
WHERE
key_id = '43d581f496bbed8a9ec75ee405b88f979b201c5257cb764ca00ee54d5d4ed578'
AND (
token = 'jWwUV6BSjQLQ3Em50nXMYrQLPoRsX37Wc8DVjzDc22c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)