UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yrBAxBg7Bv/HPgv0ecrF8hrLNM/3HleVeFMFfiHd2nA='
WHERE
key_id = '50e9a830b7675f632579788d3e3545b842dbf5deaf8f7d4774fe6eddc1eb4db7'
AND (
token = 'yrBAxBg7Bv/HPgv0ecrF8hrLNM/3HleVeFMFfiHd2nA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)