UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lDdv/edjeMUr2z8lfyJPcXwa7orvnh3VtFAVa5hmeU4='
WHERE
key_id = '4e9095d4b51395ea57db8c2df6229180f40c5cc6a0cefbdbf72cb7ca417a1b35'
AND (
token = 'lDdv/edjeMUr2z8lfyJPcXwa7orvnh3VtFAVa5hmeU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)