UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '43GlvGFo81hUqfdklClFzOoZAns1wNIRP2LgsG7BgFI='
WHERE
key_id = 'afe14ea931fb49f07acf9a066ade787a5f7ea89cfa2bbf86aa7ae170f08ddd08'
AND (
token = '43GlvGFo81hUqfdklClFzOoZAns1wNIRP2LgsG7BgFI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)