UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LhD/61KBEqktXdQtjpY8q/LxeylE1tG+cAsgOPSmsMA='
WHERE
key_id = '0819527ed2201f16087346fd38605e7fee40ad88dbba9b84d525ab0ce1534ee1'
AND (
token = 'LhD/61KBEqktXdQtjpY8q/LxeylE1tG+cAsgOPSmsMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)