UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LgI2rrEmxMfU+kV2oujdRbEnXUkCYrry+O0la/1UuIE='
WHERE
key_id = '1ecd3bee3902e39a9a894f279d104a6c02cb02924d411382f66219ef2cf4e88c'
AND (
token = 'LgI2rrEmxMfU+kV2oujdRbEnXUkCYrry+O0la/1UuIE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)