UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z7pt7XmSjjmf+c1IZwoesjTp4Wv95dYFcOxTb2TpvbI='
WHERE
key_id = 'ab1792a6d8d4b56bd3b1dfdcc86f056b761fd618cef6a61e54cb0148d2cff035'
AND (
token = 'Z7pt7XmSjjmf+c1IZwoesjTp4Wv95dYFcOxTb2TpvbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)