UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nFOXJWMd72mLgod5kmMdHehIYwk2QIcLGmK5pK7fWpI='
WHERE
key_id = '6c86d3f5e78e72c67981e8432a53d01630d823dba67b787da12767d3fca86624'
AND (
token = 'nFOXJWMd72mLgod5kmMdHehIYwk2QIcLGmK5pK7fWpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)