UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eu+87qRvI1+mDJ6CMws7x2QBkstqv259SwSLgCCGZ/8='
WHERE
key_id = 'dec31356472c6df5bc0ae4b0c529bdf4a1c3a77991952f50fed2a5cad3f8e23d'
AND (
token = 'eu+87qRvI1+mDJ6CMws7x2QBkstqv259SwSLgCCGZ/8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)