UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bjVgUcitsDfWzjT+weScpH+MYEBO+kTYWaKulIkcxOQ='
WHERE
key_id = '77a59ee60a42a9976256713d83726a8e36880274d961763571eef5668e69a0bb'
AND (
token = 'bjVgUcitsDfWzjT+weScpH+MYEBO+kTYWaKulIkcxOQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)