UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g6bjqZdxlVGOJaFS1Eq+RvTyJYzS3or7uKIfmtlXcso='
WHERE
key_id = '0d70131f2f9cf64f873e27ce190452486fedd9a5bd74b71e9ca0dc2558b46e0e'
AND (
token = 'g6bjqZdxlVGOJaFS1Eq+RvTyJYzS3or7uKIfmtlXcso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)