UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8sfS9QNGXRd7h0Mrs2SF2JPIVwhk7Eljc1rnNraMfRI='
WHERE
key_id = '8373ad4ce66145cf99dcbd8a677d926ad52a14761c00049f119bb316c091ba79'
AND (
token = '8sfS9QNGXRd7h0Mrs2SF2JPIVwhk7Eljc1rnNraMfRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)