UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cupJm/1TrDgE6U0dVqf1RO/Xlduwtvk/MA3K8GA9IEQ='
WHERE
key_id = '886e96c729698d88917fa3a882a723f3c5b5059e52614529eb74e5c4508234b4'
AND (
token = 'cupJm/1TrDgE6U0dVqf1RO/Xlduwtvk/MA3K8GA9IEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)