UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0oKK+4mDy4l10ab2y3TWSdeyHel/51xTyOGkHjWDxBM='
WHERE
key_id = '59fca08f59aee916712942f250bde5448f56204f949c00e61f1bf7b91f992b64'
AND (
token = '0oKK+4mDy4l10ab2y3TWSdeyHel/51xTyOGkHjWDxBM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)