UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Nn61ky1bY3LFJBAkqv82Pt0tehmJU1sWmQzzyvkJdw='
WHERE
key_id = '1276617c4d029e9ed2c42f0b4f6c2aac587d455fa7c55640a1414cc3e315787c'
AND (
token = '2Nn61ky1bY3LFJBAkqv82Pt0tehmJU1sWmQzzyvkJdw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)