UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0FdM9aS9m4Vq3xx/95WQOtc9Fmo6PRw36uGcHphmX7c='
WHERE
key_id = '948c60aeafa3d7fb05e461de0c389b89c033a821cbd026a6c0789c5d05263d6f'
AND (
token = '0FdM9aS9m4Vq3xx/95WQOtc9Fmo6PRw36uGcHphmX7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)