UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xnGvv9jAD1PZh9DNpZJtdGoQjsfVaCO7Mf0CQYGC/Cs='
WHERE
key_id = '6ef541d9138c62a663324e1d272fe0eb00d97b66ab81464519798549143a9756'
AND (
token = 'xnGvv9jAD1PZh9DNpZJtdGoQjsfVaCO7Mf0CQYGC/Cs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)