UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U8Qy457i9PHAVUxSYqGR+AmlT7iC8HYlv3wbwCyF7Bg='
WHERE
key_id = '91d4fa8a71fe808be09d5b4a23a23780ab2482b45edef5b4f1dd7b780a53fa84'
AND (
token = 'U8Qy457i9PHAVUxSYqGR+AmlT7iC8HYlv3wbwCyF7Bg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)