UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p1flFWUkWU36Pfo6z/xF3UY1HfhyzkQRuJTXZyD+Zw0='
WHERE
key_id = '43ddda43f7f2be47c3cfc9ae72d879a84379362504c733201a4b165723996fa7'
AND (
token = 'p1flFWUkWU36Pfo6z/xF3UY1HfhyzkQRuJTXZyD+Zw0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)