UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Qj058wy7K1K3mNoCUv9PeP/DwqBaCbQtTRN59vYMPk='
WHERE
key_id = '095ec0d30439d9401fe382bef38c7e0d0f7bbf9d74cf5ca8cba9e32de73a8afc'
AND (
token = '5Qj058wy7K1K3mNoCUv9PeP/DwqBaCbQtTRN59vYMPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)