UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MfoUvHXIasQamkcgF/mDXUn3oBSExAe9Thj+HQifrL8='
WHERE
key_id = 'f78eaab3601b577ac8cfeaeb8ac021e41db03717b958c9ee6768c421bdbaa047'
AND (
token = 'MfoUvHXIasQamkcgF/mDXUn3oBSExAe9Thj+HQifrL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)