UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iRkyR/DrXr5GxAb8vna63CNyqke3BcdupgYwMUGkOuQ='
WHERE
key_id = '456058b23f35eaf4c975817b396c19b5a5490908d08b0930e382fa8cdea1c095'
AND (
token = 'iRkyR/DrXr5GxAb8vna63CNyqke3BcdupgYwMUGkOuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)