UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Efmwhk9ZWx6SZ3a9tOni2ZJOutBohi5MvfuBTk5m0oI='
WHERE
key_id = '4713092e60d4e71d083704a3bddbf1fbecdb924bfe205f6a3c2a712fee6fee51'
AND (
token = 'Efmwhk9ZWx6SZ3a9tOni2ZJOutBohi5MvfuBTk5m0oI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)