UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't5KS+sW3T/QNKNN8zY+jni+dsvlOTNIEKPqouawOZ+c='
WHERE
key_id = '7ec937ef74fba959b75e3f8e1ab1ea02ad5fc055856c90ec08654c08500d5215'
AND (
token = 't5KS+sW3T/QNKNN8zY+jni+dsvlOTNIEKPqouawOZ+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)