UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7IG5gS6hNisAiaHJH5q7aBV4Nx6zV/+B6Lp6JeI88fQ='
WHERE
key_id = '3a0e3498b953375fd18074240329132bfb892b00934b5b315ca18117b32333cd'
AND (
token = '7IG5gS6hNisAiaHJH5q7aBV4Nx6zV/+B6Lp6JeI88fQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)